//
//  UserInfo.h
//  Chart
//
//  Created by CaoJun on 15/2/4.
//
//

#ifndef __Chart__UserInfo__
#define __Chart__UserInfo__

#include "YTXChartTools.h"
#include "EnumDefinition.h"

#import <YTXServerId/YTXServerId.h>

#include <string>

namespace ytx {
    class UserInfo;
    
    namespace TJPermissionBehaviorType {
        enum TJPermissionBehaviorType{
            HasPermission=0,
            ForThirdPartyNoPhone=1,
            AfterTrial=2,
            ForGuest=3,
            AfterTrialTT=4,
            AfterDeposit=5,
            
            EMPTY=-1
        };
    };
    
    namespace QKPermissionBehaviorType {
        enum QKPermissionBehaviorType{
            HasPermission=0,
            NoPermission=1,
            NoPhone=2,
            EMPTY=-1
        };
    };
    
    namespace QKTPermissionBehaviorType {
        enum QKTPermissionBehaviorType{
            HasPermission=0,
            NoPermission=1,
            EMPTY=-1
        };
    };
    
    namespace GameMatrixPermissionBehaviorType {
        enum GameMatrixPermissionBehaviorType{
            HasPermission=0,
            ForGuest=1,
            ForUser=2,
            EMPTY=-1
        };
    };
    
    namespace HJJTJCPermissionBehaviorType {
        enum HJJTJCPermissionBehaviorType{
            ForNoPermission=0,//无权限
            ForHasPermission=1,//有权限
            Trial=2,//试用期
            AfterTrial=3,// 试用期已过
        };
    };
    
    namespace HJJTPermissionBehaviorType {
        enum HJJTPermissionBehaviorType{
            ForNoPermission=0,
            ForJC=1,// 基础版
            ForGJ=2,// 高级版
            ForZX=3,// 尊享版
            EMPTY=-1
        };
    };
    
    namespace LSPPermissionBehaviorType {
        enum LSPPermissionBehaviorType{
            NoPermission=0,
            HasTrialPermission=1,
            HasPermission=2,//永久
            NoPermissionAfterTrial=3,//过期
            EMPTY=-1
        };
    };
    
}


namespace ytx
{
    class UserInfo
    {
    public:
        
        
    protected:
        std::string username;
        
        int usertype;
        
        long serverId;
        
        bool hasphone;
        
    public:
        UserInfo();
        
        void setUsernameAndServerId(std::string username, long serverId);
        
        std::string getUsername() const;
        
        void setUsername(std::string usernameD);
        
        void setHasPhone(bool hasphone);
        
        bool getHasPhone();
        
        void setUserType(int usertype);
        
        int getUserType();
        
        long getServerId();
        
        void setServerId(long serverId);
        
        TJPermissionBehaviorType::TJPermissionBehaviorType getTJPermissionBehaviorType(bool permission, LineType::LineType lineType);
        
        QKPermissionBehaviorType::QKPermissionBehaviorType getQKPermissionBehaviorType(bool permission, LineType::LineType lineType);
        
        QKTPermissionBehaviorType::QKTPermissionBehaviorType getQKTPermissionBehaviorType(bool permission, LineType::LineType lineType);
        
        GameMatrixPermissionBehaviorType::GameMatrixPermissionBehaviorType getGameMatrixPermissionBehaviorType(bool permission, LineType::LineType lineType);
        
        HJJTPermissionBehaviorType::HJJTPermissionBehaviorType getHJJTPermissionBehaviorType(bool permission, LineType::LineType lineType);
        
        LSPPermissionBehaviorType::LSPPermissionBehaviorType getLSPPermissionBehaviorType(int permissionType, LineType::LineType lineType);
        
        static UserInfo * getInstance();
    };
}

#endif /* defined(__Chart__UserInfo__) */
